<template>
<div style="text-align: center;background: green;padding: 5px;border-radius: 5px;color: white;position: fixed;left: 0;right: 0;bottom: 20px" @click="honbao">跳转到红包首页</div>
</template>
<script>
export default {
  props: "",
  data() {
    return {
      time: 0,
      countdownElement: '',
      countdownInterval: 0
    };
  },
  mounted() {
    this.honbao()
  },
  methods: {
    honbao(){
      //是否已登录
      $http.post("test.is_login", {  }, "loading").then(
        (response) => {
          let time = response.data.is_login
          if(time == 0){
            //跳转导登录页
            this.$router.push(this.fun.getUrl("login"));
          }else{
            let uid = response.data.uid
            //调用登录
            adutil.islogin(uid)
            let url =  window.localStorage.getItem('tz_url')
            if(url && url!= undefined && typeof(url)!='undefined'){
              window.location.href = url
            }else{
              this.$router.push(this.fun.getUrl("home"));
            }
          }
        }
      )
    }
  }
}
</script>



<style scoped lang="scss">

</style>